package com.zq.qq2;

import android.content.Context;
import android.media.MediaPlayer;
import android.os.Vibrator;

/**
 * Created by xuebiao on 16/3/20.
 */
public class MediaUtil {
    public final static void vibrater(Context context, int sec) {
        MediaPlayer player = MediaPlayer.create(context, R.raw.message);
        player.start();
        Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
        vibrator.vibrate( sec * 1000);
    }
    public final static void Vibrater(final Context context, final int raw, int sec) {

        MediaPlayer player = MediaPlayer.create(context, raw);
        player.start();

        Vibrator vibrator = (Vibrator) context.getSystemService(Context.VIBRATOR_SERVICE);
        vibrator.vibrate( sec * 1000);
    }
    public final static void Notify(Context context, int raw) {
        MediaPlayer player = MediaPlayer.create(context, raw);
        player.start();
    }
}
